package io.gitee.twoke.generator.spring.boot.actuate.endpoint;

import io.gitee.twoke.generator.engine.GenerateEngine;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

@ConfigurationProperties(prefix = "endpoints.generator")
@Endpoint(id = "generator")
public class GenerateEngineEndpoint {

    private final GenerateEngine generateEngine;

    public GenerateEngineEndpoint(GenerateEngine generateEngine) {
        this.generateEngine = generateEngine;
    }

    @ReadOperation
    public Map<String, Object> invoke() {
        Map<String, Object> metrics = new HashMap<String, Object>();

        return metrics;
    }

    private long secondsForDays(int days) {
        int hour = 60 * 60 * 1000;
        int day = 24 * hour;
        return days * day;
    }
}